import { AliServer } from './ali.service'
import { Resolver, Query, Mutation } from '@nestjs/graphql'
import { CoreAli } from './ali.entity'
@Resolver('Ali')
export class AliResolver {
  constructor(private ali: AliServer) {}
  @Query('alis')
  async getAliList(): Promise<CoreAli[]> {
    return await this.ali.getAliList()
  }

  @Mutation('addAli')
  async addAli(_, { name, accessKeyID, accessKeySecret }) {
    return await this.ali.addAli({
      name,
      accessKeyID,
      accessKeySecret
    })
  }

  @Mutation()
  addAliSmsSign() {}

  @Mutation()
  addAliSmsTemplate() {}
}
